package en.kaist.cs408.acav;

import java.util.regex.Pattern;

public class Verifier {
	
	public enum VerifResult {Compare_Error, Length_Error, Fine};
	
	public boolean verifyCourseID(String courseID){
		String regex="^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]{3,19}";
		return Pattern.matches(regex, courseID);
	}
	
	public boolean verifyStudentID(String studentID){
		String regex="^[0-9]{8,10}";
		return Pattern.matches(regex, studentID);
	}
	
	public int verifyPassword(String password1, String password2){
		if (password1.compareTo(password2) != 0) return -1;
		if (password1.length()<=7 || password1.length()>=21) return -2;
		else return 0;
	}
	
	public int verifyPassword(String password1){
		if (password1.length()<=7 || password1.length()>=21) return -2;
		else return 0;
	}
	
}
